package de.sendorian.app.forumArchive.matcher;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import de.sendorian.util.matcher.BlacklistMatcher;


public class IgnorableImageMatcher extends BlacklistMatcher<String> {

    protected static final List<String> unwantedImageTypes = new ArrayList<String>();

    static {
        unwantedImageTypes.add(".gif");
        unwantedImageTypes.add("smiley");
        unwantedImageTypes.add("sample");
        unwantedImageTypes.add("preview");
        unwantedImageTypes.add("sheet");
        unwantedImageTypes.add("screenshot");
        unwantedImageTypes.add("forumbanner");
    }


    public IgnorableImageMatcher() {
        super(unwantedImageTypes);
    }


    @Override
    protected boolean matchesInternal(String imageUrl, Object unwantedImageType) {
        return StringUtils.containsIgnoreCase(imageUrl, (String) unwantedImageType);
    }

}
